export default function uploadfile(obj) {
	return new Promise((resolve, reject) => {
		var BASE_URL = "https://file.xhm2006.com"; //file.cloudmis.cn/fileUpload
		var url = BASE_URL + obj.url;
		var filePath = obj.filePath; //文件上传的路径
		var postdata = JSON.stringify(obj.postdata);
		console.log(obj, 'obj')
		console.log(postdata, 'postdata')
		uni.uploadFile({
			url: url, //仅为示例，非真实的接口地址http://192.168.2.195:5007/fileUpload
			filePath: filePath,
			formData: {
				postdata
			},
			name: 'file',
			success: (res) => {
				console.log(res, 'success')
				if (typeof res.data == 'string' && res.data != undefined) {
					var ress = JSON.parse(res.data)
					console.log(ress, 'ress')
					// if (ress.success) { //如果参数不对的话会造成 不会then出去返回值  即便orderid为空 也接受不到
					resolve(ress)
					// }
				}
			},
			fail: (error) => {
				console.log(error, 'errprsssss')
				reject(error)
			}
		});
	})
}
